from django.db import models

class Commodity(models.Model):
    name = models.CharField(max_length=100)
    price = models.FloatField()
    number = models.IntegerField()
    desc = models.CharField(max_length=100)

    class Meta:
        db_table = "day03_shopp"

    def __str__(self):
        return self.name

class Shopping_Cart(models.Model):
    commodity = models.ForeignKey(Commodity, on_delete=models.CASCADE)
    number = models.IntegerField()

    class Meta:
        db_table = "day03_shopping_cart"

    def __str__(self):
        return self.commodity.name